diff options
| author | it-fixcomart <it@fixcomart.co.id> | 2025-01-22 16:32:14 +0700 |
|---|---|---|
| committer | it-fixcomart <it@fixcomart.co.id> | 2025-01-22 16:32:14 +0700 |
| commit | dd66804b05166ad6bb71bf54fe3374d9897fee86 (patch) | |
| tree | 19b8a314a067e65ab82f6a04fd8005c2e718ee39 /src/pages/daftar-merchant/[status].jsx | |
| parent | 4a23d0c7c880b67d571ca34efe93cbf2c1bba721 (diff) | |
<iman> handle approce atau review merchant
Diffstat (limited to 'src/pages/daftar-merchant/[status].jsx')
| -rw-r--r-- | src/pages/daftar-merchant/[status].jsx | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/src/pages/daftar-merchant/[status].jsx b/src/pages/daftar-merchant/[status].jsx index e69de29b..61c07571 100644 --- a/src/pages/daftar-merchant/[status].jsx +++ b/src/pages/daftar-merchant/[status].jsx @@ -0,0 +1,47 @@ +import BasicLayout from '@/core/components/layouts/BasicLayout'; +import IsAuth from '@/lib/auth/components/IsAuth'; +import StatusMerchant from '@/lib/merchant/components/AccountSwitch'; +import { useRouter } from 'next/router'; +import axios from 'axios'; +import { useState, useEffect } from 'react'; +import Seo from '@/core/components/Seo'; +import { getAuth } from '~/libs/auth'; + +export async function getServerSideProps(context) { + const { status } = context.query; + // await axios.post( + // `${process.env.NEXT_PUBLIC_SELF_HOST}/api/pengajuan-tempo/${status}`, + // {}, + // { headers: context.req.headers } + // ); + return { props: {} }; +} + +export default function Finish() { + const [isLoading, setIsLoading] = useState(true); + const router = useRouter(); + const auth = getAuth(); + useEffect(() => { + if (!auth) { + const nextUrl = encodeURIComponent(router.asPath); + router.push(`/login?next=${nextUrl}`); + } else { + setIsLoading(false); + } + }, [auth]); + + if (isLoading || !auth) { + return null; // Tidak render apa pun selama loading atau auth/tempo belum tersedia + } + return ( + <> + <Seo title='Pengajuan Tempo Indoteknik.com' /> + + <IsAuth> + <BasicLayout> + <StatusMerchant query={router.query || {}} /> + </BasicLayout> + </IsAuth> + </> + ); +} |
